import request from '@/utils/request'

import variable from '@/utils/variables'
const baseURL = variable.URL.baseURL

// 公开协议列表
export function getOpenList(params) {
	return request({
	    baseURL: baseURL,
	    url: '/order/protocol_base/list',
	    method: 'POST',
	    data: params
	})
}
// 公开协议列表  多个条件筛选
export function getOpenListSearch(params) {
	return request({
	    baseURL: baseURL,
			url:'/order/protocol_base/search',
	    method: 'POST',
	    data: params
	})
}
// order/protocol_base/search
// 公开协议详情
export function getOpenXdetail(params) {
	return request({
	    baseURL: baseURL,
	    url: '/order/protocol_base/detail',
	    method: 'GET',
	    params: params
	})
}


export function createXorder(params) {
	return request({
	    baseURL: baseURL,
	    url: '/order/settle/protocol_order',
	    method: 'POST',
	    data: params
	})
}

// 协议订单详情
export function getXOrderDetail(params) {
	return request({
	    baseURL: baseURL,
	    url: '/order/protocol/detail',
	    method: 'GET',
	    params: params
	})
}

// 上传协议订单文件
export function xorderUpload(params) {
	return request({
	    baseURL: baseURL,
	    url: '/file/agreement_order/upload',
	    method: 'POST',
	    data: params
	})
}
//

// 协议订单上传协议
export function xorderProtocol(params) {
	return request({
	    baseURL: baseURL,
	    url: '/order/protocol/order_img',
	    method: 'PUT',
	    data: params
	})
}

// 协议订单 取消订单
export function xorderCancelOrder(params) {
	return request({
	    baseURL: baseURL,
	    url: '/order/cancel_order',
	    method: 'POST',
	    params: params
	})
}


//  收货地址
export function orderQueryAddress(params) {
	return request({
	    baseURL: baseURL,
	    url: '/order/protocol/order_address',
	    method: 'PUT',
	    params: params
	})
}

//  申请退款
export function orderApplyRefund(params) {
	return request({
	    baseURL: baseURL,
	    url: '/order/protocol/apply_refund',
	    method: 'POST',
	    params: params
	})
}

//  申请延期付款
export function orderApplyDelayedPay(params) {
	return request({
	    baseURL: baseURL,
	    url: '/order/protocol/apply_delayed_pay',
	    method: 'POST',
	    params: params
	})
}

// 申请平台介入
export function orderApplyIntervention(params) {
	return request({
	    baseURL: baseURL,
	    url: '/order/protocol/apply_platform_Intervention',
	    method: 'POST',
	    params: params,
	})
}

// 确定结算
export function orderConfirmCompletion(params) {
	return request({
	    baseURL: baseURL,
	    url: '/order/protocol/confirm_completion',
	    method: 'PUT',
	    params: params
	})
}

// 消息

// 获取协议邀约详情
export function orderProtocolInvitedetail(params) {
	return request({
	    baseURL: baseURL,
	    url: '/order/protocol_invite/detail',
	    method: 'GET',
	    params: params
	})
}

// 接受协议邀约
export function orderProtocolInviteAccept(params) {
	return request({
	    baseURL: baseURL,
	    url: '/order/protocol_invite/accept',
	    method: 'PUT',
	    params: params
	})
}
